package hellfire.system.graphics;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;

import hellfire.system.engine.Main;

public class GLTextureImage extends GLImage
{
	
	//texture coords buffer
	public static final FloatBuffer texCoordBuffer;
	
	public static float textureCoords[] = 
	{
		0.0f, 0.0f,		// bottom left	(V1)	
		0.0f, 1.0f,		// top left		(V2)
		1.0f, 0.0f,		// bottom right	(V3)
		1.0f, 1.0f,		// top right	(V4)
	};

    static 
    {
    	ByteBuffer bb = ByteBuffer.allocateDirect(textureCoords.length * 4);
        bb.order(ByteOrder.nativeOrder());
        texCoordBuffer = bb.asFloatBuffer();
        texCoordBuffer.put(textureCoords);
        texCoordBuffer.position(0);
    }
	
	public GLTextureImage(int textureId, GLVec2 pos, GLVec2 dim) 
	{
		super(0, pos, dim);
		this.cache.set(0, textureId);
	}
	
	public void setImageResource(int resource)
    {
    	
    }
	
	@Override
	protected FloatBuffer getTexCoordBuffer()
	{
		return texCoordBuffer;
	}

}
